package com.class04.ioc_02;

import jakarta.annotation.PostConstruct;
import jakarta.annotation.PreDestroy;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

@Scope(scopeName = ConfigurableBeanFactory.SCOPE_PROTOTYPE)
@Component//<bean id = javaBean class=JavaBean>
public class JavaBean {
//    周期方法命名随意  public void 没有行数


    @PostConstruct
    public void init(){
        System.out.println("javaBean.init");
    }
    @PreDestroy
    public void destroy(){
        System.out.println("JavaBean.destroy");
    }
}
